package com.example.musictutor.domain;

import com.example.musictutor.conf.Constants;

public class SongNote extends Note {
	private long songNoteId;
	private long songId;
	private int startPosition;
	private int endPosition;
	private int tempo;

	public SongNote() {
		super();
	}
	
	public SongNote(String name, int resourceId) {
		super(name, resourceId);
	}
	
	public SongNote(String name, int resourceId, int start, int end) {
		super(name, resourceId);
		startPosition = start;
		endPosition = end;
	}
	
	public long getSongNoteId() {
		return songNoteId;
	}

	public void setSongNoteId(long songNoteId) {
		this.songNoteId = songNoteId;
	}

	public long getSongId() {
		return songId;
	}

	public void setSongId(long id) {
		this.songId = id;
	}

	public int getStartPosition() {
		int start = startPosition;
		
		/*double factor = tempo / Constants.DEFAULT_TEMPO;
		double newStart = start * factor;
		return (int) newStart;*/
		return startPosition;
	}

	public void setTempo(int tempo) {
		this.tempo = tempo;
	}
	
	public void setStartPosition(int startPosition) {
		
		/*double factor = Constants.DEFAULT_TEMPO / tempo;
		double newStart = startPosition * factor;
		this.startPosition = (int) newStart;*/
		this.startPosition = startPosition;
	}

	public int getEndPosition() {
		return endPosition;
	}

	public void setEndPosition(int endPosition) {
		this.endPosition = endPosition;
	}
	
}
